/**
 * Created by 49588 on 2018-08-02.
 */

import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);

const state = {
    //token: '',
    userInfo: '',
    //userId: ''
}

const mutations = {
    setUser(state){
        let userInfo = JSON.parse(localStorage.getItem('userInfo'));
        //state.token = user.token;
        state.userInfo = userInfo;
        //state.userId = user.userId;
    },
    clearUser(state){
        //state.token = '';
        state.userInfo = '';
        //state.userId = '';
    }
};
/*const actions = {
    setUser(count){

        context.commit('setUser',userInfo)
    }
}*/


export default new Vuex.Store({
    state,
    mutations,
})
